package com.vmladenov.cook;

import android.app.Application;

import com.vmladenov.cook.core.db.DataHelper;
import com.vmladenov.cook.core.objects.User;
import com.vmladenov.cook.ui.CustomCountDown;

public class CustomApplication extends Application
{
	private static CustomApplication _instance = null;

	public CustomApplication()
	{
		_instance = this;
	}

	@Override
	public void onCreate()
	{
		super.onCreate();
		_instance.dataHelper = new DataHelper(getApplicationContext());
		_instance.setCurrentUser(new User(-1, ""));
	}

	private DataHelper dataHelper;
	private User currentUser;
	public CustomCountDown customCountDown;

	public static synchronized CustomApplication getInstance()
	{
		if (_instance == null)
		{
			_instance = new CustomApplication();
		}
		return _instance;
	}

	public DataHelper getDataHelper()
	{
		return dataHelper;
	}

	public User getCurrentUser()
	{
		return currentUser;
	}

	public void setCurrentUser(User currentUser)
	{
		this.currentUser = currentUser;
	}

}
